extends Node2D

var is_achieved : bool = false

func conditionChecker() -> bool:
	return false

func callback() -> void:
	$"/root/Game/Mechanics/DarkerScreenTimer".stop()
	
	while $"/root/Game/GlobalLightLevel".color.a <= 0.95:
		$"/root/Game/GlobalLightLevel".color.a += 0.01
		await get_tree().create_timer(0.02).timeout

	var Ending_2 = Preload.Ending_2_Scene.instantiate()
	add_child(Ending_2)

	Global.is_game_paused = true
	get_tree().paused = true
	$"/root/Game/UILayer/GamingUI".hide()
	$"/root/Game/UILayer/GameOverMenu".hide()
	$"/root/Game/UILayer/AchievementsMenu/Achievement2/ColorRect".color.a = 0
	Global.G_best_score = max(Global.G_best_score, Global.G_score)
